<?php
   class Model_destination extends CI_Model{
		protected $_table = "tbl_destination";
		public function __construct(){
			parent::__construct();
			$this->load->database();
		}
		public function getdata($id){
			$this->db->where("id",$id);
			return $this->db->get($this->_table)->row_array();
		}
		public function getcolunm_alldestination($column){
			$this->db->select($column);
			return $this->db->get($this->_table)->result_array();
		}
		public function listall($limit,$start){
			$this->db->limit($limit,$start);
			return $this->db->get($this->_table)->result_array();
		}
		public function add($data){
        	$this->db->insert($this->_table,$data);
		}
		public function del($id){
			$this->db->where("id",$id);
			$this->db->delete($this->_table);
		}
		public function update($data,$id){
			$this->db->where("id",$id);
			$this->db->update($this->_table,$data);
		}
		public function countrow(){
			$query=$this->db->query("select count(*) as total from tbl_destination");	
			return $query->row_array();
		}
		
		public function countbyprovide($provide){
			$query=$this->db->query("select count(*) as total from tbl_destination where provide like '%".$provide."%'");	
			return $query->row_array();
		}
	}